<template>
  <div class="ass-info-card">
    <div class="ass-info-card-left">
      <div class="ass-info-card-header">
        <h2>{{ basicInfo }}</h2>
      </div>
      <div class="ass-info-card-content">
        <div>
          <span>社团名称:</span>
          <span>{{ props.applyInfo?.name }}</span>
        </div>
        <div>
          <span>学生负责人:</span>
          <span>{{ props.applyInfo?.associationStudentName }}</span>
        </div>
        <div>
          <span>负责人学号:</span>
          <span>{{ props.applyInfo?.associationStudentNumber }}</span>
        </div>
        <div>
          <span>联系方式:</span>
          <span>{{ props.applyInfo?.associationStudentPhone }}</span>
        </div>
        <div>
          <span>指导老师:</span>
          <span>{{ props.applyInfo?.teacherName }}</span>
        </div>
        <div>
          <span>老师联系方式:</span>
          <span>{{ props.applyInfo?.teacherPhone }}</span>
        </div>
      </div>
      <div class="ass-info-btn">
        <el-button type="primary" round size="large" v-debounce="{ fn: pass }">通过</el-button>
        <el-button type="danger" round size="large" v-debounce="{ fn: noPass }">不通过</el-button>
      </div>
    </div>
    <div class="ass-info-card-right">
      <div class="ass-info-card-top">
        <div class="ass-info-card-header">
          <h2>{{ interestInfo }}</h2>
        </div>
        <div class="ass-info-card-content">
          <!-- 社团简介 -->
          <el-input
            :value="props.applyInfo ? props.applyInfo.associationIntroduction : ''"
            :rows="5"
            type="textarea"
            :readonly="true"
            resize="none"
            style="font-size: 20px;"
          />
        </div>
      </div>
      <!-- 照片墙 -->
      <div class="demo-image">
        <div class="ass-info-card-header">
          <h2>{{ photoWall }}</h2>
        </div>
        <div v-for="fit in props.applyInfo?.photo" :key="fit" class="block">
          <el-image
            style="width: 100px; height: 100px"
            :src="['http://175.178.51.126' + fit.photoPath].toString()"
          />
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang='ts'>
import { defineProps } from 'vue';

import ManagerRequest from '../api/ManagerRequest'
// import GetInfo from '@/api/GetInfo';

const props = defineProps({
  applyInfo: {
    type: Object,
    require: true,
  }
})
const id = props.applyInfo ? props.applyInfo.id : -1;
// //获取照片墙信息
// GetInfo.selectPhotoWall(id).then((response)=>{
//   console.log(response);
// })

//社团审核通过
const pass = () => {
  ManagerRequest.adoptUser(id)
}

//社团审核不通过
const noPass = () => {
  ManagerRequest.failUser(id)
}

const basicInfo = '基本信息';
const interestInfo = '社团简介';
const photoWall = '照片墙';

</script>

<style scoped lang="scss">
.demo-image .block {
  padding: 0.1875rem 0;
  text-align: left;
  border-right: solid 1px var(--el-border-color);
  display: inline-block;
  width: 20%;
  box-sizing: border-box;
  vertical-align: top;
}
.demo-image .block:last-child {
  border-right: none;
}
.demo-image .demonstration {
  display: block;
  color: var(--el-text-color-secondary);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.ass-info-card {
  display: flex;
  font-size: 1.25rem;
  color: #8a8888;
  width: 1129px;
  min-height: 28rem;
  margin: 0 auto;
  margin-top: 2rem;
  padding-right: 15px;
  background-color: #fff;
  border: 1px solid #707070;
  border-radius: 3.125rem;
  box-shadow: 0.625rem 0.625rem 0.75rem 0.0625rem #8a8888;
  .ass-info-card-header {
    h2 {
      font-weight: 700;
      font-size: 1.6rem;
      color: #3f89b9;
    }
    margin-bottom: 0.9375rem;
  }

  .ass-info-card-left {
    position: relative;
    top: 0;
    left: 0;
    width: 21.4375rem;
    padding-left: 1.875rem;
    padding-top: 1.25rem;
    border-right: 1px solid #8a8888;
    .ass-info-card-content {
      line-height: 2.5rem;
    }
    .ass-info-btn {
      margin-top: 3rem;
      margin-bottom: 2rem;
      button {
        width: 7.5rem;
        margin-right: 0.9375rem;
      }
    }
  }
  .ass-info-card-right {
    width: 48.9375rem;
    padding: 1.25rem;
    .ass-info-card-content {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      height: 11.875rem;
    }
  }
}
</style>